package org.orion.engine;

import javax.media.opengl.GL;

public class RenderBuffer {
	private int id;
	private int type;
	private int width;
	private int height;
	
	public RenderBuffer(int type, int width, int height){
		this.width = width;
		this.height = height;
		this.type = type;
		int[] ids = new int[1];
		GLStatic.gl.glGenRenderbuffersEXT(1, ids, 0);
		this.id = ids[0];
		glBind();
		GLStatic.gl.glRenderbufferStorageEXT(GL.GL_RENDERBUFFER_EXT, type, width, height);
	}
	
	public void glBind(){
		GLStatic.gl.glBindRenderbufferEXT(GL.GL_RENDERBUFFER_EXT, id);
	}

	public int getType() {
		return type;
	}

	public int getHeight() {
		return height;
	}

	public int getWidth() {
		return width;
	}

	public int getId() {
		return id;
	}

}

